package com.gtd.account

import javax.jdo.annotations.*;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
class ContactInfo implements Serializable {

	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	Key key

	@Persistent
	String fullName

	@Persistent
	String nickname

	@Persistent(mappedBy="contactInfo")
	List<EmailAddress> emailAddresses

	@Persistent(mappedBy="contactInfo")
	List<LocalAddress> localAddresses

	@Persistent(mappedBy="contactInfo")
	List<PhoneNumber> phoneNumbers

	@Persistent
	ContactGroup contactGroup

	@Persistent
	User user //Nullable

    static constraints = {
		key nullable:true
		fullName blank:false
		nickname nullable:true
		emailAddresses nullable:true
		localAddresses nullable:true
		phoneNumbers nullable:true
		contactGroup nullable:true
		user nullable:true
	}
}
